package net.bwie.jtp.mapper;

import net.bwie.jtp.bean.TrafficPvReport;
import net.bwie.jtp.bean.TrafficUvReport;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: 🌹帅的一塌糊涂🌹
 * @description:
 * @params: 日志流量各个渠道统计映射
 * @return:
 * @date: 2025/5/21 14:07
 */@Mapper
public interface TrafficChannelStatsMapper {
    // TODO: 2025/5/21 获取各渠道独立访客数
    @Select(
            "select channel,sum(uv_count) as uv_count\n"+
                    "from jtp_log_report.dws_log_page_view_window_report\n"+
                    "where toDate(window_start_time)=#{date} group by channel"
    )
    List<TrafficUvReport> selectUvCount(@Param("date")String date);
    // TODO: 2025/5/24 获取各渠道的pv浏览量
    @Select(
            "select channel,sum(pv_count) as pv_count\n" +
                    "from jtp_log_report.dws_log_page_view_window_report\n" +
                    "where toDate(window_start_time) = #{date} group by channel"
    )
    List<TrafficPvReport> selectPvCount(@Param("date")String date);
}
